package com.disease.chronic.Service.Impl;

import com.disease.chronic.Exception.ChronicExceptionEnum;
import com.disease.chronic.Global.Result;
import com.disease.chronic.Mappers.IndicatorsMapper;
import com.disease.chronic.Service.IndicatorService;
import com.disease.chronic.pojo.Indicators;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IndicatorServiceImpl implements IndicatorService {
    @Autowired
    IndicatorsMapper indicatorsMapper;
    @Override
    public Result selectIndicator(String username) {
        return new Result(ChronicExceptionEnum.SUCCESS.getCode(),
                ChronicExceptionEnum.SUCCESS.getMessage(),
                indicatorsMapper.selectAll(username));
    }

    @Override
    public Indicators selectByUsernameAndIndicatorName(String username, String indicatorName) {
        return indicatorsMapper.selectByUsernameAndIndicatorName(username,indicatorName);
    }
}
